﻿<!--#include file="include/config.asp"-->
<!--#include file="include/conn_f.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<p align="center">
    <%
cust_id=left(saferequest("id",2),7)
vcode=left(saferequest("vcode",2),20)
newpwd=left(saferequest("newpwd",2),10)
newpwd2=left(saferequest("newpwd2",2),10)

If newpwd="" or newpwd2="" Then
    %>
    <form action="resetpwd.asp" method="post">
    请输入新的密码:<input name="newpwd" type="password" maxlength="10">(6-10位)<br />
    重复输入新密码:<input name="newpwd2" type="password" maxlength="10"><br />
    <input name="id" value="<%=cust_id%>" type="hidden">
    <input name="vcode" value="<%=vcode%>" type="hidden">
    <input type="submit" value="确认更改">
    </form>
    <%
Else
    If newpwd<>newpwd2 or len(newpwd)<6 Then
        Response.Write "两次输入的新密码不相同,或密码长度不够,请重输!"
    %>
    <form action="resetpwd.asp" method="post">
    请输入新的密码:<input name="newpwd" type="password" maxlength="10"><br />
    重复输入新密码:<input name="newpwd2" type="password" maxlength="10"><br />
    <input name="id" value="<%=cust_id%>" type="hidden">
    <input name="vcode" value="<%=vcode%>" type="hidden">
    <input type="submit" value="确认更改">
    </form>
    <%
    Else
        sql="select username from customer where cust_id="&cust_id&" and password='"&vcode&"' "
        Set rs=conn.execute(sql)

        If Not rs.eof Then
            sql="update customer set password=old_password('"&newpwd&"') where cust_id="&clng(cust_id)
            conn.execute sql

            Set objfilesys=Server.CreateObject("scripting.filesystemobject")
            Set objstream=objfilesys.openTextFile("c:\xiaofm\login_log\cust_login_log.txt",8)
            objstream.writeLine(now()&"|"&IP&"|"&rs("username")&"|ResetPassword")
            Set objfilesys=Nothing
            Set objstream=Nothing	
            Response.Write "会员帐号:"&rs("username")&"<br />"
            Response.Write "密码重置成功,请用新的密码登录!"
        Else
            Response.Write "无效的密码重置服务!"
        End If
    End If
End If
    %>
    
    <!--#include file="bottom.asp"-->
